import json

class Solution:
    def example(self):
        while True:
            try:
                a = int(input())
                list1 = list(map(int, input().split()))
                b = int(input())
                list2 = list(map(int, input().split()))
                list3 = set(list1 + list2)
                list3 = sorted(list3)
                print(''.join(map(str, list3)))
            except:
                break

    def mergerArray(self, list1, list2):
        list3 = set(list1 + list2)
        list3 = sorted(list3)
        return list3


if __name__ == '__main__':
    list1 = json.loads(input().strip())
    list2 = json.loads(input().strip())
    print(Solution().mergerArray(list1, list2))
    